<nav>
  <%= tabs_tag(:namespace => :sub_nav, :open_tabs => {}, :builder => MenuTabBuilder) do |tab| %>
    <% if current_admin.can?(controller: "admin/programs") %>
      <li>
        <a herf="#">
          <i class="fa fa-lg fa-fw fa-map-marker"></i> 
          <span class="menu-item-parent">
            节目管理 
          </span>
        </a>
        <ul>
          <% CityChannel.all.collect(&:city_id).uniq.each do |city_id| %>
            <% city_name = CityChannel.where(:city_id => city_id).first.city_name %>
            <%= eval %{ tab.program_#{city_id} city_name, admin_programs_path(city_id: city_id, city_name: city_name) } %>
          <% end %>
        </ul>      
      </li>    
    <% end %>

    <%= tab.tv '<i class="fa fa-lg fa-fw fa-video-camera"></i> 
        <span class="menu-item-parent">
          EPG管理 
        </span>'.html_safe, admin_televisions_path if current_admin.can?(controller: "admin/televisions") %>
    <%#= tab.city_channel '<i class="fa fa-lg fa-fw fa-folder"></i> 
        <span class="menu-item-parent">
          目录管理 
        </span>'.html_safe, admin_city_channels_path if current_admin.can?(controller: "admin/city_channels") %>
  <% end %>
</nav>